<template>
  <div>
    <div class="row">
      <div class="col-xs-offset-2 col-xs-8">
        <div class="page-header"><h2>Router Test</h2></div>
      </div>
    </div>

    <div class="row">
      <div class="col-xs-2 col-xs-offset-2">
        <div class="list-group">
          <!--生成路由链接-->
          <router-link to="/about" class="list-group-item">About</router-link>
          <router-link to="/home" class="list-group-item">Home</router-link>
        </div>
      </div>
      <div class="col-xs-6">
        <div class="panel">
          <div class="panel-body">
            <!--路由切换视图-->
            <keep-alive> <!--保持路由组件为活动状态keep alive，不会犹豫路由的切换而被消亡-->
              <router-view msg="msg"></router-view> <!--router使用router view传递参数-->
            </keep-alive>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'App',
  components: {

  },
  data () {
   return {

   }
  },
  mounted () {// 初始化加载

  },
  methods: {

  }
}
</script>


<style>
  .router-link-active {
    color: red !important;
  }
</style>
